package com.cvmars.jianyou.widget;

import android.content.Context;
import android.text.TextPaint;

import com.cvmars.jianyou.utils.DensityUtils;

import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;

/**
 * Created by hehaifeng on 2018/12/2.
 */

public class FindTextSizeChangTitleView extends ColorTransitionPagerTitleView {
    public FindTextSizeChangTitleView(Context context) {
        super(context);
        inits(context);
    }


    private void inits(Context context) {
        int padding = DensityUtils.dip2px(context, 10);
        setPadding(padding, 0, padding, 0);
    }

    @Override
    public void onSelected(int index, int totalCount) {

        this.setTextSize(25);
        TextPaint paint = this.getPaint();
        paint.setFakeBoldText(true);
    }

    @Override
    public void onDeselected(int index, int totalCount) {

        this.setTextSize(17);
        TextPaint paint = this.getPaint();
        paint.setFakeBoldText(false);
    }
}
